<?php
declare(strict_types=1);
namespace Field;

class AigcNavLinkConst
{
    public const pk='';
    public const index=['AigcNavLinkID'];
	public const fields=['AigcNavLinkID','AigcNavID','AttachID','LinkName','LinkDesc','LinkUrl','CreateAt','UpdateAt','IndexShow','IndexRank','Icon','Status'];
	public const comment=['AigcNavLinkID'=>'链接ID','AigcNavID'=>'分类ID','AttachID'=>'图片素材','LinkName'=>'连接名称','LinkDesc'=>'链接描述','LinkUrl'=>'链接地址','CreateAt'=>'','UpdateAt'=>'','IndexShow'=>'','IndexRank'=>'','Icon'=>'','Status'=>'状态'];
	/*
    * @Field AigcNavLinkID
    * @Type int(11)
    * @Collation 
    * @Null NO
    * @Key PRI
    * @Default 0
    * @Extra 
    * @Privileges select,insert,update,references
    * @Comment 链接ID
    */
    public const AigcNavLinkID = 'AigcNavLinkID';
    /*
    * @Field AigcNavID
    * @Type int(11)
    * @Collation 
    * @Null YES
    * @Key MUL
    * @Default 0
    * @Extra 
    * @Privileges select,insert,update,references
    * @Comment 分类ID
    */
    public const AigcNavID = 'AigcNavID';
    /*
    * @Field AttachID
    * @Type int(11)
    * @Collation 
    * @Null YES
    * @Key 
    * @Default 
    * @Extra 
    * @Privileges select,insert,update,references
    * @Comment 图片素材
    */
    public const AttachID = 'AttachID';
    /*
    * @Field LinkName
    * @Type varchar(64)
    * @Collation utf8mb4_general_ci
    * @Null NO
    * @Key 
    * @Default 
    * @Extra 
    * @Privileges select,insert,update,references
    * @Comment 连接名称
    */
    public const LinkName = 'LinkName';
    /*
    * @Field LinkDesc
    * @Type varchar(200)
    * @Collation utf8mb4_general_ci
    * @Null YES
    * @Key 
    * @Default 
    * @Extra 
    * @Privileges select,insert,update,references
    * @Comment 链接描述
    */
    public const LinkDesc = 'LinkDesc';
    /*
    * @Field LinkUrl
    * @Type varchar(200)
    * @Collation utf8mb4_general_ci
    * @Null YES
    * @Key 
    * @Default 
    * @Extra 
    * @Privileges select,insert,update,references
    * @Comment 链接地址
    */
    public const LinkUrl = 'LinkUrl';
    /*
    * @Field CreateAt
    * @Type timestamp
    * @Collation 
    * @Null YES
    * @Key 
    * @Default CURRENT_TIMESTAMP
    * @Extra 
    * @Privileges select,insert,update,references
    * @Comment 
    */
    public const CreateAt = 'CreateAt';
    /*
    * @Field UpdateAt
    * @Type timestamp
    * @Collation 
    * @Null YES
    * @Key 
    * @Default CURRENT_TIMESTAMP
    * @Extra on update CURRENT_TIMESTAMP
    * @Privileges select,insert,update,references
    * @Comment 
    */
    public const UpdateAt = 'UpdateAt';
    /*
    * @Field IndexShow
    * @Type int(11)
    * @Collation 
    * @Null YES
    * @Key 
    * @Default 
    * @Extra 
    * @Privileges select,insert,update,references
    * @Comment 
    */
    public const IndexShow = 'IndexShow';
    /*
    * @Field IndexRank
    * @Type int(11)
    * @Collation 
    * @Null YES
    * @Key 
    * @Default 
    * @Extra 
    * @Privileges select,insert,update,references
    * @Comment 
    */
    public const IndexRank = 'IndexRank';
    /*
    * @Field Icon
    * @Type text
    * @Collation utf8mb4_general_ci
    * @Null YES
    * @Key 
    * @Default 
    * @Extra 
    * @Privileges select,insert,update,references
    * @Comment 
    */
    public const Icon = 'Icon';
    /*
    * @Field Status
    * @Type int(11)
    * @Collation 
    * @Null YES
    * @Key 
    * @Default 0
    * @Extra 
    * @Privileges select,insert,update,references
    * @Comment 状态
    */
    public const Status = 'Status';
}

class AigcNavLinkColumns
{
public  int $AigcNavLinkID;
   public  int $AigcNavID=0;
   public  int $AttachID=0;
   public  string $LinkName;
   public  ?string $LinkDesc='';
   public  ?string $LinkUrl='';
   public  ?string $CreateAt='';
   public  ?string $UpdateAt='';
   public  int $IndexShow=0;
   public  int $IndexRank=0;
   public  ?string $Icon='';
   public  int $Status=0;
	public function toArray():array
	{
		return [
'AigcNavLinkID'=>$this->AigcNavLinkID,
    'AigcNavID'=>$this->AigcNavID,
    'AttachID'=>$this->AttachID,
    'LinkName'=>$this->LinkName,
    'LinkDesc'=>$this->LinkDesc,
    'LinkUrl'=>$this->LinkUrl,
    'CreateAt'=>$this->CreateAt,
    'UpdateAt'=>$this->UpdateAt,
    'IndexShow'=>$this->IndexShow,
    'IndexRank'=>$this->IndexRank,
    'Icon'=>$this->Icon,
    'Status'=>$this->Status,        ];
	}
}

class AigcNavLinkRow
{
	public AigcNavLinkColumns $data;
	public function toArray():array
	{
		return $this->data->toArray();
    }

    public function getValue(string $field):string|int|null
    {
        return match ($field){
        'AigcNavLinkID' => $this->data->AigcNavLinkID,
        'AigcNavID' => $this->data->AigcNavID,
        'AttachID' => $this->data->AttachID,
        'LinkName' => $this->data->LinkName,
        'LinkDesc' => $this->data->LinkDesc,
        'LinkUrl' => $this->data->LinkUrl,
        'CreateAt' => $this->data->CreateAt,
        'UpdateAt' => $this->data->UpdateAt,
        'IndexShow' => $this->data->IndexShow,
        'IndexRank' => $this->data->IndexRank,
        'Icon' => $this->data->Icon,
        'Status' => $this->data->Status, default=>null
        };
    }

    public function __construct(array $data)
    {
        $this->data = new AigcNavLinkColumns();
        isset($data['AigcNavLinkID']) && $this->data->AigcNavLinkID = (int)$data['AigcNavLinkID'];
           isset($data['AigcNavID']) && $this->data->AigcNavID = (int)$data['AigcNavID'];
           isset($data['AttachID']) && $this->data->AttachID = (int)$data['AttachID'];
           isset($data['LinkName']) && $this->data->LinkName = (string)$data['LinkName'];
           isset($data['LinkDesc']) && $this->data->LinkDesc = (string)$data['LinkDesc'];
           isset($data['LinkUrl']) && $this->data->LinkUrl = (string)$data['LinkUrl'];
           isset($data['CreateAt']) && $this->data->CreateAt = (string)$data['CreateAt'];
           isset($data['UpdateAt']) && $this->data->UpdateAt = (string)$data['UpdateAt'];
           isset($data['IndexShow']) && $this->data->IndexShow = (int)$data['IndexShow'];
           isset($data['IndexRank']) && $this->data->IndexRank = (int)$data['IndexRank'];
           isset($data['Icon']) && $this->data->Icon = (string)$data['Icon'];
           isset($data['Status']) && $this->data->Status = (int)$data['Status'];
    }
}
?>